package com.tmc.util;

import com.tmc.constant.OrderConstant;

public class OrderUtil {
	
	public static String getOrderStatusName(String type){
		if(ObjectUtil.noText(type)){
			return type;
		}
		if(type.equals(OrderConstant.ORDER_STATUS_BOOKING)){
			return "订座中";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_CHECKING)){
			return "待审核";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_REFUSED)){
			return "已拒回";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_PAYING)){
			return "待付款";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_CANCELED)){
			return "取消订单";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_TICKETING)){
			return "待出票";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_TICKETED)){
			return "已出票";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_CHANGING)){
			return "待改期";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_CHANGED)){
			return "已改期";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_REFUNDING)){
			return "待退票";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_REFUNDED)){
			return "已退票";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_INVALIDING)){
			return "待废票";
		}
		if(type.equals(OrderConstant.ORDER_STATUS_INVALIDED)){
			return "已废票";
		}
		return type;
	}
	
	public static String getCardTypeName(String type){
		if(ObjectUtil.noText(type)){
			return type;
		}
		if("1,2,3,4,6,7,8,10,22,23,24,25,26,27,99".contains(type)){
			switch (type) {
			case "1": return "身份证";
			case "2": return "护照";
			case "3": return "学生证";
			case "4": return "军人证";
			case "6": return "驾驶证";
			case "7": return "回乡证";
			case "8": return "台胞";
			case "10": return "港澳通行证";
			case "22": return "台湾通行证";
			case "23": return "士兵证";
			case "24": return "临时身份证";
			case "25": return "户口簿";
			case "26": return "警官证";
			case "27": return "出生证明";
			case "99": return "其它";
			default:
				break;
			}
		}
		return type;
	}
	
	public static String getPassengerTypeName(String type){
		if(ObjectUtil.noText(type)){
			return type;
		}
		if(type.equals(OrderConstant.PASSENGER_TYPE_ADT)){
			return "成人";
		}
		if(type.equals(OrderConstant.PASSENGER_TYPE_CHD)){
			return "儿童";
		}
		if(type.equals(OrderConstant.PASSENGER_TYPE_INF)){
			return "婴儿";
		}
		return type;	
	}
	
	public static String getPlatformName(String type){
		if(ObjectUtil.noText(type)){
			return type;
		}
		if(type.equals(OrderConstant.PLATFORM_CTRIP)){
			return "携程";
		}
		if(type.equals(OrderConstant.PLATFORM_ZIYING)){
			return "本地订单";
		}
		if(type.equals(OrderConstant.PLATFORM_QUNAER)){
			return "去哪儿";
		}
		if(type.equals(OrderConstant.PLATFORM_TAOBAO)){
			return "淘宝";
		}
		if(type.equals(OrderConstant.PLATFORM_TONGCHENG)){
			return "同城";
		}
		return type;
	}
	public static String getGenderName(String type){
		if(ObjectUtil.noText(type)){
			return type;
		}
		if(type.equals("M")){
			return "男";
		}
		if(type.equals("F")){
			return "女";
		}
		return type;
	}
	public static String getTicketingTypeName(Integer type){
		if(type == null){
			return "";
		}
		if(type.equals(OrderConstant.TICKETING_TYPE_MANUAL)){
			return "自动出票";
		}
		if(type.equals(OrderConstant.TICKETING_TYPE_AUTOMATIC)){
			return "手动出票";
		}
		return type.toString();
	}
}
